<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <link rel="stylesheet" href="css/amazeui.min.css"/>
    <link rel="stylesheet" href="css/admin.css"/>
    <script type="text/javascript">
        function p_del() {
            var msg = "您确定要删除该演员吗？";
            if (confirm(msg) == true) {
                return true;
            } else {
                return false;
            }
        }
    </script>
</head>
<body>
<div class="admin-content-body">
    <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">角色管理</strong><small></small></div>
    </div>

    <hr>

    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span>
                        <a href="${pageContext.request.contextPath}/add.jsp">添加</a>
                    </button>
                </div>
            </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">

        </div>
        <form action="${pageContext.request.contextPath}/SelectActorByName" method="post">
            <div class="am-u-sm-12 am-u-md-3">
                <div class="am-input-group am-input-group-sm">
                    <input type="text" class="am-form-field" name="keywords" placeholder="请输入姓名查询">
                    <span class="am-input-group-btn"><button class="am-btn am-btn-default"
                                                             type="submit">搜索</button></span>
                </div>
            </div>
        </form>
    </div>
    <div class="am-g">
        <div class="am-u-sm-12">
            <form class="am-form">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                    <tr>
                        <th class="table-id">ID</th>
                        <th class="table-title">first_name</th>
                        <th class="table-type">last_name</th>
                        <th class="table-author am-hide-sm-only">last_update</th>
                        <th class="table-set">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${requestScope.actorsList}" var="a">
                        <tr>
                            <td>${a.ID }</td>
                            <td>${a.first_name}</td>
                            <td>${a.last_name}</td>
                            <td class="am-hide-sm-only">${fn:substring(a.last_update, 0, 19)}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                        <button class="am-btn am-btn-default am-btn-xs am-text-secondary">
                                            <a href="${pageContext.request.contextPath}/EditActorById?id=${a.ID}">编辑</a>
                                            <span class="am-icon-pencil-square-o"></span>
                                        </button>
                                        <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only">
                                            <a href="${pageContext.request.contextPath}/DeleteActorById?id=${a.ID }"
                                               onclick="javascript:return p_del()">删除</a>
                                            <span class="am-icon-trash-o"></span>
                                        </button>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <tr>
                    <td>首页</td>
                    <a href="#">首页</a>
                    <td><a href="#">上一页</a></td>
                    <td><a href="#">下一页</a></td>
                    <a href="#">尾页</a>
                    <td>尾页</td>
                </tr>
            </form>

        </div>
    </div>
</div>
</body>
</html>